﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace PokerService
{
    [DataContract]
    public class Player
    {
        IGameCallBack playerCallBack;
        int seatNr;
        string action;
        int turn;
        private Card card1;
        private Card card2;
        public int comboValue;
        public Player(string username, string password, int money, int moneyOnTable, bool isPlaying)
        {
            Username = username;
            Password = password;
            Money = money;
            MoneyOnTable = moneyOnTable;
            IsPlaying = isPlaying;
            MovesList = new List<Move>();
            //PlayerCallBack = playerCallBack;
            SeatNr = seatNr;
            IsYourTurn = false;
            Action = null;
            Turn = turn;
            comboValue = 0;
        }

        [DataMember]
        public string Username { get; set; }

        [DataMember]
        public string Password { get; set; }

        [DataMember]
        public int Money { get; set; }

        [DataMember]
        public int MoneyOnTable { get; set; }

        [DataMember]
        public int SeatNr { get; set; }

        [DataMember]
        public bool IsPlaying { get; set; }

        [DataMember]
        public bool IsYourTurn { get; set; }

        [DataMember]
        public List<Move> MovesList { get; set; }

        [DataMember]
        public string Action { get; set; }

        public int Turn { get; set; }

        public IGameCallBack PlayerCallBack { get; set; }

        public Card Card1
        {
            get { return card1;}
            
            set 
            { 
                card1 = value;
                //this.PlayerCallBack.giveCards(SeatNr, Card1.ToString(), 1); //call to client that he got the card 
            } 
        }

        public Card Card2
        {
            get { return card2; }

            set
            {
                card2 = value;
                //this.playerCallBack.giveCards(SeatNr, Card1.ToString(), Card2.ToString()); //call to client that he got the card 
            }
        }

        
    }
}
